﻿@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
    IEnumerable<DNA.Mvc.WebPage> missingTitlePages = ViewBag.MissingTitle;
    IEnumerable<DNA.Mvc.WebPage> missingDescPages = ViewBag.MissingDesc;
    IEnumerable<DNA.Mvc.WebPage> missingKeywordsPages = ViewBag.MissingKeywords;
    IEnumerable<DNA.Mvc.WebPage> shortDescPages = ViewBag.ShortDescPages;
    IEnumerable<DNA.Mvc.WebPage> shortTitlePages = ViewBag.ShortTitlePages;
    IEnumerable<DNA.Mvc.WebPage> longDescPages = ViewBag.LongDescPages;
    IEnumerable<DNA.Mvc.WebPage> longTitlePages = ViewBag.LongTitlePages;
}
@UIHelper.ImageTitle(Html.Global("SEO_Report_Suggest"), Html.Global("SEO_Report_Suggest_Des"), "~/content/images/icon_search_suggestions.png")
@if (missingTitlePages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Missing_Title") + " ({0})", missingTitlePages.Count()))
    @_RenderPageLink(missingTitlePages)
}
@if (missingDescPages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Missing_Desc") + " ({0})", missingDescPages.Count()))
    @_RenderPageLink(missingDescPages)
}
@if (missingKeywordsPages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Missing_Keywords") + " ({0})", missingKeywordsPages.Count()))
    @_RenderPageLink(missingKeywordsPages)
}
@if (longTitlePages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Long_Title") + " ({0})", longTitlePages.Count()))
    @_RenderPageLink(longTitlePages)
}
@if (shortTitlePages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Short_Title") + " ({0})", shortTitlePages.Count()))
    @_RenderPageLink(shortTitlePages)
}
@if (longDescPages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Long_Desc") + " ({0})", longDescPages.Count()))
    @_RenderPageLink(longDescPages)
}
@if (shortDescPages.Count() > 0)
{
    @UIHelper.SectionHeader(string.Format(Html.Global("SEO_Report_Short_Desc") + " ({0})", shortDescPages.Count()))
    @_RenderPageLink(shortDescPages)
}
@helper _RenderPageLink(IEnumerable<DNA.Mvc.WebPage> pages)
    {
        foreach (var page in pages)
        {
    <p>
        @Ajax.Dna().Link(Url.Action("Edit", new { id = page.ID, returnUrl = Url.Action("SEOSuggestions", new { Area = "", website = WebSiteContext.Current.Web.Name }) })).Text(UrlResolver.Resolve(page)).ImageIcons(Url.Content("~/content/images/icon_aspx_16.png")).GetHtml()
    </p>
        }
}